#!/usr/bin/env python
# -*- coding: utf-8 -*- 
import random
import sys
import curses
import time


noti = "ahdghjsfgdzfhjsghjfghdsjghfjgshjgfshjbvcsgjfgjhs"
noti += " "
leihoTam = 30
i = 0
print noti+"-",len(noti)
sys.stdin.readline()


stdscr = curses.initscr()
curses.noecho()
curses.cbreak()
stdscr.nodelay(1)
key = 0



try:
    while key != 113:
        i += 1
        if (i+leihoTam) == len(noti):
            i=0
        stdscr.addstr(0, 0, noti[i:i+leihoTam])
        time.sleep(0.1)
        key = stdscr.getch()

finally:
    curses.echo()
    curses.nocbreak()
    curses.endwin()
    sys.stderr.write("\x1b[2J\x1b[H")

    
        
